﻿<?php

$connect = mysql_connect('localhost', 'tass', '114'); // DB 연결
if ($connect) {
//    echo "접속성공<br/>";
}else {
//    echo "접속실패<br/>";
}

$db_id=mysql_select_db("tass",$connect);  // DB 선택

if($db_id) {
//    echo "데이터베이스 선택성공<br/>";
}else {
//    echo "데이터베이스 선택실패<br/>";
}
//mysql_query("set names euckr");


$userID = $_REQUEST['user'];

$sql = "SELECT * FROM login_info WHERE id = 'userID';";

$rs = mysql_query($sql, $connect);

while($result = mysql_fetch_array($rs)){
  $id = $result[id];
  $name = $result[name];
  $pw = $result[pw];
      
$xmlList.="<user><id>$id</id><name>$name</name><pw>$pw</pw></user>";

}
mysql_free_result($rs);

$xmlDoc="<?xml version='1.0' encoding='utf-8'?> <root>$xmlList</root>";

//$fp = fopen("test.xml","w");
//fput($fp, $xmlDoc);
//fclose($fp);

//echo $sql;

 echo    $xmlDoc;


?>